﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OUS_HUB
{
    public partial class FormToast : Form
    {
        /// <summary>
        /// 初始化
        /// </summary>
        public FormToast(string lableText, int width, Color backgroudColor, Color fontColor, int showTime)
        {
            InitializeComponent();
            pictureBox.Hide();
            if (showTime > 2000)
            {
                pictureBox.Show();
            }
            this.label.ForeColor = fontColor;
            this.label.Text = lableText;
            this.Width = width;
            this.BackColor = backgroudColor;
            Timer timer = new Timer();
            timer.Interval = showTime;
            timer.Start();
            timer.Tick += timer_Tick;
        }

        void timer_Tick(object sender, System.EventArgs e)
        {
            this.Close();
        }

        private void FormToast_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }

        private void pictureBox_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }
    }
}
